package com.mf.cloud.controller;

import cn.hutool.core.util.IdUtil;
import com.mf.cloud.entities.Pay;
import com.mf.cloud.resp.ResultData;
import com.mf.cloud.service.PayService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: lmf
 * @Create: 2024/3/18 22:36
 * Description:  测试网关接口
 */
@RestController
@RequestMapping("/pay/gateWay")
@Tag(name = "测试网关接口")
public class PayGateWayController {
    @Resource
    private PayService payService;

    @GetMapping("/get/{id}")
    @Operation(summary = "测试接口")
    public ResultData<Pay> getPayGatewayById(@PathVariable("id") Integer id) {
        return ResultData.success(payService.selectById(id));
    }

    @Operation(summary = "info测试接口")
    @GetMapping("/info")
    public ResultData<String> getPayGatewayInfo(){
        return ResultData.success("调用getPayGateway接口成功" + IdUtil.simpleUUID());
    }
}
